﻿<UserControl x:Class="ExampleControlBing.Page"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:layoutToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Layout.Toolkit"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <UserControl.Resources> 
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/DeepEarth.BingMapsToolkit.Client.Common;component/Resources/CommonStyles.xaml" />
            </ResourceDictionary.MergedDictionaries>
            <Style x:Key="ReadOnlyTextBoxStyle" TargetType="TextBox">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="TextBox">
                            <Grid x:Name="RootElement">
                                <ScrollViewer x:Name="ContentElement" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" BorderThickness="0"/>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>       
        </ResourceDictionary>
        <DataTemplate x:Key="ListTemplate">
            <TextBlock Text="{Binding Path=Title}" TextWrapping="Wrap" />
        </DataTemplate>       
    </UserControl.Resources>

    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.RowDefinitions>
            <RowDefinition Height="62" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="200" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <StackPanel Grid.ColumnSpan="2" Orientation="Horizontal" >
            <Image Source="/ExampleControlBing;component/deepearth.jpg" Stretch="None" />
            <TextBlock Text="Bing Maps Toolkit" VerticalAlignment="Center" FontSize="32"/>
        </StackPanel>
        <Grid Grid.Column="0" Grid.Row="1">
            <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
                <layoutToolkit:Accordion x:Name="acc" HorizontalAlignment="Stretch" VerticalAlignment="Top" >
                    <layoutToolkit:AccordionItem Header="Controls" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" >
                        <ListBox x:Name="ExampleControlList" ItemTemplate="{StaticResource ListTemplate}" Style="{StaticResource ListBoxStyle}" />                  
                    </layoutToolkit:AccordionItem>
                    <layoutToolkit:AccordionItem Header="Data Demos" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" >
                        <ListBox x:Name="ExampleDataList" ItemTemplate="{StaticResource ListTemplate}" Style="{StaticResource ListBoxStyle}" />
                    </layoutToolkit:AccordionItem>
                    <layoutToolkit:AccordionItem Header="Application Examples" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" >
                        <ListBox x:Name="ExampleAppList" ItemTemplate="{StaticResource ListTemplate}" Style="{StaticResource ListBoxStyle}" />
                    </layoutToolkit:AccordionItem>
                </layoutToolkit:Accordion>
            </ScrollViewer>
        </Grid>
        <Grid Grid.Column="1" Grid.Row="1" >
            <Grid.RowDefinitions>
                <RowDefinition Height="2*" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <Grid x:Name="ExamplePanel" Background="Black"></Grid>
            <Grid Grid.Row="1">
                <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
                    <TextBox HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True" x:Name="ExampleSource" Margin="8,8,8,8" Style="{StaticResource ReadOnlyTextBoxStyle}" />
                </ScrollViewer>
            </Grid>
        </Grid>
    </Grid>
</UserControl>
